﻿@using Fyp.Models;
@{
    Layout = "~/Shared/_layoutPage.cshtml";
    string s = "c";
    List<SelectListItem> items = new List<SelectListItem>();
    items.Add(new SelectListItem
    {
        Text = "Select Task Type",
        Value = "0",
        Selected = true
    });
    items.Add(new SelectListItem
    {
        Text = "Assigned",
        Value = "Assigned",
    });
    items.Add(new SelectListItem
    {
        Text = "Submitted",
        Value = "Submitted"
    });
    var PageTitle = "Submit Daily Task";
    string t = "Task ";
}
@section title
{
    @PageTitle;
}        
<html>
<head>
<link rel="stylesheet" type="text/css" href="~/Styles/template.css" media="screen">
<style type="text/css">
#TaskListMainDiv
{
    background-color: azure;
    width:950px;
    margin-left:5px;
    height:auto;
}
#TaskListMainDiv #TaskListForm 
{
    margin-top:0px;
    margin-left:54px;
    height:auto;
    margin-bottom:0px;
}
#TaskListMainDiv #TaskListForm #DropDownList1
{
   margin-top:80px;
   margin-left:-655px;
}
#TaskListMainDiv #TaskListForm #AssignedTaskListDiv
{   
    margin-left:63px;
    height:auto;
    width:900px;
}
#TaskListMainDiv#TaskListForm #AssignedTaskListDiv #AssignedTaskListTable 
{
    margin-left:170px;
    text-align:center;   
    width:250px;
    border:1px solid green;
    padding:2px;
}
#TaskListMainDiv#TaskListForm #AssignedTaskListDiv #AssignedTaskListTable th
{
    width:100px;
    text-align:center;  
}
#TaskListMainDiv #TaskListForm #SubmittedTaskListDiv  
{
    margin-left:63px;
    height:auto;
    width:900px;
}     
#TaskListMainDiv#TaskListForm #SubmittedTaskListDiv #SubmittedTaskListTable
{ 
   margin-left:70px;
   text-align:center;
   width:250px;
}
#TaskListMainDiv#TaskListForm #SubmittedTaskListDiv #SubmittedTaskListTable th
{ 
    width:100px;
    text-align:center;
}
td 
{
border:1px solid green; 
padding:2px;    
}
th 
{
    background-color:green;
    color:white;
    padding:2px;
    border:1px solid green; 
}
</style>
<script src="/Scripts/jquery-1.8.2.js" type="text/javascript"></script>
<script src="/Scripts/jquery-ui.js" type="text/javascript"></script>
<link rel="stylesheet" href="/Styles/jquery-ui.css" />
<link href="../../Styles/jquery.ambiance.css" rel="stylesheet" type="text/css" />
<script src="../../Scripts/jquery.ambiance.js" type="text/javascript"></script>
<link rel="stylesheet" href="/Styles/jquery.timeentry.css" />
<script type="text/javascript" src="/Scripts/jquery.timeentry.js"></script>
<script>
    $(document).ready(function () {
        
            $('#SubmittedTaskListDiv').hide();
            $('#AssignedTaskListDiv').show();
            $("#DropDownList1").change(function () {
            var text = $("#DropDownList1 option:selected").text();
            if ($("#DropDownList1 option:selected").val() =="Assigned") {
                $('#SubmittedTaskListDiv').hide();
                $('#AssignedTaskListDiv').show();
            }
            if ($("#DropDownList1 option:selected").val() == "Submitted")    {
                $('#SubmittedTaskListDiv').show();
                $('#AssignedTaskListDiv').hide();   
          }
        });
    });
    function f1() {
        window.location = "/SubmitDailyTask/StudentView";
    }
</script>
</head>
<body>
<div id="TaskListMainDiv">
<div id="content" style="margin-left: 98px;margin-bottom: -1px;"><h2 style="text-align: center;"><b>View Task List</b></h2><br/></div>
@using (Html.BeginForm("ShowTasks", "SubmitDailyTask", FormMethod.Post, new { enctype = "multipart/form-data", @id = "TaskListForm" }))
{
<br/><br/>
@Html.DropDownList("DropDownList1", items)   
<input type="Submit" value="ShowTasks" name="button" class="buttonSave" style="margin-left:25px"/>     
<div id="AssignedTaskListDiv">
<br/><br/>    
<table id="AssignedTaskListTable" border="1">
 <thead>
       <tr>
       <th>Task No</th>
       <th>Task Type</th>
       <th>Description</th>
       <th>Assigned By</th>
       <th>Date</th>
       <th>Time</th>
       <th>Download Attachment</th>
       </tr>
       </thead>
       <tbody>
     @for (int i = 0; i < global.indtasklst.Count(); i++)
       {
           <tr>
               <td>@t@global.indtasklst[i].TId</td>
               <td><label >Individual</label></td>
               <td><label>@global.indtasklst[i].Description</label></td>
               <td><label>@global.indtasklst[i].AdvisorName</label></td>
               <td><label>@global.indtasklst[i].Assigned_Date</label></td>
               <td><label>@global.indtasklst[i].Assigned_Time</label></td>
             <td><a href="@global.indtasklst[i].Assigned_Task_Path" target="_blank">Download Task</a> </td>
           </tr>
       }
       @for (int j = 0; j < global.grptasklst.Count(); j++)
       {
           <tr>
               <td>@t @global.grptasklst[j].TId</td>
               <td><label >Group</label></td>
               <td><label>@global.grptasklst[j].Description</label></td>
               <td><label>@global.grptasklst[j].AdvisorName</label></td>
               <td><label>@global.grptasklst[j].Date</label></td>
               <td><label>@global.grptasklst[j].Time</label></td>
               <td><a href="@global.grptasklst[j].Path" target="_blank">Download Task</a> </td>
           </tr>
       }
</tbody>
</table>
</div>    
<div id="SubmittedTaskListDiv">
<br/><br/>          
<table id="SubmittedTaskListTable" border="1">
       <thead>
       <tr>
       <th>Task No</th>
       <th>Task Type</th>
       <th>Description</th>
       <th>Assigned By</th>
       <th>Date</th>
       <th>Time</th>
       <th>Download Attachment</th>
       </tr>
       </thead>
       <tbody>
     @for (int i = 0; i < global.indtasklst.Count(); i++)
       {
           <tr>
               <td>@t @global.indtasklst[i].TId</td>
               <td><label >Individual</label></td>
               <td><label>@global.indtasklst[i].Description</label></td>
               <td><label>@global.indtasklst[i].AdvisorName</label></td>
               <td><label>@global.indtasklst[i].Assigned_Date</label></td>
               <td><label>@global.indtasklst[i].Assigned_Time</label></td>
               @*<td><a href="@Fyp.global.indtasklst[i].Assigned_Task_Path" target="_blank">Download Task</a></td>*@
               <td>@Html.ActionLink("Download Task", global.indtasklst[i].Assigned_Task_Path); </td>
           </tr>
       }
       @for (int j = 0; j < global.grptasklst.Count(); j++)
       {
           <tr>
               <td>@t @global.grptasklst[j].TId</td>
               <td><label >Group</label></td>
               <td><label>@global.grptasklst[j].Description</label></td>
               <td><label>@global.grptasklst[j].AdvisorName</label></td>
               <td><label>@global.grptasklst[j].Date</label></td>
               <td><label>@global.grptasklst[j].Time</label></td>
               <td><a href="Data\ng_all.js.txt"  target="_blank">Download Task</a> </td>
                 @*<td>@Html.ActionLink("Download Task", Fyp.global.grptasklst[j].Path);</td>*@
           </tr>
       }
</tbody>
 </table>
</div>
<br/><br />
<input type="button" id="btnnext" value="Next" class="buttonSave" onclick="f1()" style="margin-left:63px" />
}
</div>
</body>
</html>


